package org.auf.controllers;

import java.io.IOException;
import java.util.Collection;

import org.apache.log4j.Logger;
import org.auf.core.Controller;
import org.auf.model.dao.IEventDAO;
import org.auf.model.jdbc.EventDAOJDBC;
import org.auf.to.Event;

public class ShowAllEventsController extends Controller {

	static Logger log = Logger.getLogger(ShowAllEventsController.class.getName());

	@Override
	public void show() {
		IEventDAO eventdao = EventDAOJDBC.getInstance();
		Collection<Event> eventos = eventdao.selectAllEvent();
		if(eventos==null)
			log.error("La coleccion de eventos es nula");
		view.load("event");
		view.assignVar("geek", new Boolean(user.getGeek()).toString());
		view.assignVar("colEvent",eventos);
		view.show();
	}
}
